import os
'''
create websockify token conf 
@auth liuhailong
@date 2019.7.25
'''
hosts=['10.3.37.200','10.3.37.201','10.3.37.202'] # open vnc server list
ports='5900-32766' # you need vnc port {start - end}
token=''
for host in hosts:
    for port in range(int(ports.split('-')[0]),int(ports.split('-')[1])):
        token+="%s: %s:%s\n"%(host.replace('.','')+str(port),host,port)
with open(os.path.abspath(".")+'/token.conf','w') as fp:
    fp.write(token)